home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wg_lib / arryctlf.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  6.9 KB  |  231 lines

  1. VERSION 2.00
  2. Begin Form ArryCtlFrm 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Fast Control Array Operations"
  5.    ClientHeight    =   4470
  6.    ClientLeft      =   1185
  7.    ClientTop       =   1590
  8.    ClientWidth     =   7470
  9.    Height          =   4875
  10.    Left            =   1125
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   4470
  14.    ScaleWidth      =   7470
  15.    Top             =   1245
  16.    Width           =   7590
  17.    Begin CommandButton TestCmd 
  18.       Caption         =   "Test"
  19.       Height          =   435
  20.       Left            =   5475
  21.       TabIndex        =   13
  22.       Top             =   3180
  23.       Width           =   1110
  24.    End
  25.    Begin Frame VFrame 
  26.       BackColor       =   &H00C0C0C0&
  27.       Height          =   1590
  28.       Left            =   255
  29.       TabIndex        =   6
  30.       Top             =   2580
  31.       Width           =   4545
  32.       Begin ListBox VList 
  33.          BackColor       =   &H00C0C0C0&
  34.          Height          =   810
  35.          Left            =   165
  36.          TabIndex        =   8
  37.          Top             =   660
  38.          Visible         =   0   'False
  39.          Width           =   1950
  40.       End
  41.       Begin TextBox Vres 
  42.          Height          =   555
  43.          Left            =   2535
  44.          MultiLine       =   -1  'True
  45.          TabIndex        =   9
  46.          Top             =   585
  47.          Width           =   1590
  48.       End
  49.       Begin ComboBox VCombo 
  50.          BackColor       =   &H00C0C0C0&
  51.          Height          =   300
  52.          Left            =   210
  53.          TabIndex        =   7
  54.          Top             =   225
  55.          Width           =   1935
  56.       End
  57.    End
  58.    Begin TextBox Msg 
  59.       Height          =   840
  60.       Left            =   5055
  61.       MultiLine       =   -1  'True
  62.       TabIndex        =   14
  63.       Top             =   2010
  64.       Width           =   2130
  65.    End
  66.    Begin Frame Cframe 
  67.       BackColor       =   &H00C0C0C0&
  68.       Height          =   885
  69.       Left            =   5145
  70.       TabIndex        =   10
  71.       Top             =   615
  72.       Width           =   1995
  73.       Begin OptionButton CtlOpt 
  74.          BackColor       =   &H00C0C0C0&
  75.          Caption         =   "List Control"
  76.          Height          =   285
  77.          Index           =   2
  78.          Left            =   195
  79.          TabIndex        =   12
  80.          Top             =   510
  81.          Width           =   1545
  82.       End
  83.       Begin OptionButton CtlOpt 
  84.          BackColor       =   &H00C0C0C0&
  85.          Caption         =   "Combo Control"
  86.          Height          =   330
  87.          Index           =   1
  88.          Left            =   180
  89.          TabIndex        =   11
  90.          Top             =   195
  91.          Value           =   -1  'True
  92.          Width           =   1575
  93.       End
  94.    End
  95.    Begin Frame IFrame 
  96.       BackColor       =   &H00C0C0C0&
  97.       Height          =   1590
  98.       Left            =   240
  99.       TabIndex        =   0
  100.       Top             =   480
  101.       Width           =   4500
  102.       Begin ListBox IList 
  103.          BackColor       =   &H00C0C0C0&
  104.          Height          =   810
  105.          Left            =   195
  106.          TabIndex        =   3
  107.          Top             =   660
  108.          Visible         =   0   'False
  109.          Width           =   1935
  110.       End
  111.       Begin TextBox IRes 
  112.          BackColor       =   &H00FFFFFF&
  113.          Height          =   555
  114.          Left            =   2475
  115.          MultiLine       =   -1  'True
  116.          TabIndex        =   4
  117.          Top             =   555
  118.          Width           =   1605
  119.       End
  120.       Begin ComboBox ICombo 
  121.          BackColor       =   &H00C0C0C0&
  122.          Height          =   300
  123.          Left            =   180
  124.          TabIndex        =   2
  125.          Top             =   210
  126.          Width           =   1935
  127.       End
  128.    End
  129.    Begin Label Label2 
  130.       BackColor       =   &H00C0C0C0&
  131.       Caption         =   "VB Operations"
  132.       Height          =   285
  133.       Left            =   285
  134.       TabIndex        =   5
  135.       Top             =   2340
  136.       Width           =   1455
  137.    End
  138.    Begin Label Label1 
  139.       BackColor       =   &H00C0C0C0&
  140.       Caption         =   " WGlib Operations"
  141.       Height          =   255
  142.       Left            =   255
  143.       TabIndex        =   1
  144.       Top             =   195
  145.       Width           =   1680
  146.    End
  147. DefInt A-Z
  148. Dim Arry() As String
  149. Sub CtlOpt_Click (Index As Integer)
  150.     If Index = 2 Then
  151.         CBClearList ICombo
  152.         CBClearList VCombo
  153.         VCombo.visible = 0
  154.         ICombo.visible = 0
  155.         VList.visible = 1
  156.         IList.visible = 1
  157.     Else
  158.         Call LBClearList(IList)
  159.         Call LBClearList(VList)
  160.         VList.visible = 0
  161.         IList.visible = 0
  162.         VCombo.visible = 1
  163.         ICombo.visible = 1
  164.     End If
  165.     Ires.text = ""
  166.     Vres.text = ""
  167. End Sub
  168. Sub Form_Load ()
  169.     ' init the array now
  170.     ReDim Arry$(1 To 2500)
  171.     screen.mousepointer = 11
  172.     For x = 1 To UBound(Arry$)
  173.         Arry$(x) = "Element " + Str$(x)
  174.     Next x
  175.     screen.mousepointer = 0
  176. End Sub
  177. Sub Form_Paint ()
  178.     ConvexFrm ArryCtlFrm, 4
  179.     ConcaveCtl Ires, 3
  180.     ConcaveCtl Vres, 3
  181.     ConvexCtl CFrame, 3
  182.     ConcaveCtl Msg, 4
  183. End Sub
  184. Sub TestCmd_Click ()
  185.     Ires.text = ""
  186.     Vres.text = ""
  187.     Msg.text = ""
  188.     If CtlOpt(1).value Then         ' Combo
  189.        Call CBClearList(VCombo)
  190.        CBClearList ICombo
  191.          Msg.text = "Doing VB test"
  192.          screen.mousepointer = 11
  193.          vs! = Timer
  194.          For x = 1 To UBound(Arry$)
  195.             VCombo.AddItem Arry$(x)
  196.          Next x
  197.          vel! = Timer - vs!
  198.          screen.mousepointer = 0
  199.          Vres.text = "Complete.         Time: " + Format$(vel!) + " secs"
  200.          'errc = CBShowList(VCombo)
  201.          VCombo.ListIndex = 0
  202.          VCombo.Refresh
  203.          Msg.text = "Doing Our test"
  204.          ws! = Timer
  205.          ArrayToCombo ICombo, Arry$(1), UBound(Arry$)
  206.          wel! = Timer - ws!
  207.          Ires.text = "Complete.         Time: " + Format$(wel!)
  208.          'errc = CBShowList(ICombo)
  209.          ICombo.ListIndex = 0
  210.          ICombo.Refresh
  211.     Else
  212.        LBClearList VList
  213.        LBClearList IList
  214.          Msg.text = "Doing VB test"
  215.          screen.mousepointer = 11
  216.          vs! = Timer
  217.          For x = 1 To UBound(Arry$)
  218.             VList.AddItem Arry$(x)
  219.          Next x
  220.          vel! = Timer - vs!
  221.          screen.mousepointer = 0
  222.          Vres.text = "Complete.         Time: " + Format$(vel!) + " secs"
  223.          Msg.text = "Doing Our test"
  224.          ws! = Timer
  225.          ArrayToList IList, Arry$(1), UBound(Arry$)
  226.          wel! = Timer - ws!
  227.          Ires.text = "Complete.         Time: " + Format$(wel!)
  228.     End If
  229.     Msg.text = "The Complementary operations of Ctl->Array are equally as fast!"
  230. End Sub
  231.